<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" />
<script language="JavaScript" type="text/javascript" src="js/jquery-latest.js"></script>
<script type="text/javascript" src="js/thickbox.js"></script>

<script language="JavaScript">
var paramValidated = true;
	
function showReport()
{

	var startDate = document.getElementById("startDate").value;
	var mm1 = parseInt(startDate.substring(0,2),10);
	var dd1 = parseInt(startDate.substring(3,5),10);
	var yy1 = parseInt(startDate.substring(6,10),10);
	var d1 = new Date(yy1, mm1-1, dd1);
	var endDate = document.getElementById("endDate").value;
	var mm2 = parseInt(endDate.substring(0,2),10);
	var dd2 = parseInt(endDate.substring(3,5),10);
	var yy2 = parseInt(endDate.substring(6,10),10);
	var d2 = new Date(yy2,mm2-1, dd2);
	var currDate = new Date();
	if(currDate < d1)
	{
		alert("'From date' cannot be greater than 'Current Date' ");
	    paramValidated= false;
	}
	if(d2 < d1)
    {
	  alert("'To date' cannot be less than 'From date'");
	  paramValidated= false;
    }	
	if(currDate< d2)
	{
		alert("'To date' cannot be greater than 'Current Date' ");
	    paramValidated= false;
	}
	var ename= document.getElementById("exam_name").value;
	var fname = document.getElementById("first_name").value;

	var param="&fname="+fname+"&ename="+ename+"&status="+document.getElementById("status").value;
	var param1= "&isNegative="+document.getElementById("negative_enable").value+"&isMultiple="+document.getElementById("multiple_choice_enable").value;
	var dateParam = "&startDate="+document.getElementById("startDate").value+"&endDate="+document.getElementById("endDate").value;

	param=param+param1+dateParam;
	//var param="&ename="+ename;
	
	var src ="/birt/frameset?__report=examwiseUserReport.rptdesign&title=Examwise%20Report"+param;
	document.getElementById("reportURL").value = src;
}
</script>
<script language="JavaScript" src="js/Calendar.js" type="text/JavaScript"></script>
<input name="reportURL"  id="reportURL" type="hidden"  />
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	  	<tr>
	    	<td>
	    		<table width="100%" border="0" cellspacing="0" cellpadding="0">
	  				<tr>
						<jsp:include page="reportActionTab.jsp"/>	
	  				</tr>
				</table>
			</td>
  		</tr>
  		<tr>
			<td class="formbg" valign="top">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
    					<td>
    						<table width="100%" border="0" cellspacing="4" cellpadding="0">
  								<tr>
	    							<td>&nbsp;</td>
									<td>&nbsp;</td>
	    							<td>&nbsp;</td>
									<td>&nbsp;</td>
								    <td>&nbsp;</td>
								    <td>&nbsp;</td>
  								</tr>
								<tr>
	    							<td colspan="6"><jsp:include page="showErrorMessage.jsp" /></td>
								</tr>
								<tr>
									<td>&nbsp;</td>
									<td class="formText">Exam Name</td>
									<td valign="middle" ><input type="text" name="exam_name" id="exam_name" maxlength="30" class="form1"/></td>
									<td class="formText">User Name</td>
									<td valign="middle" ><input type="text" name="first_name" id="first_name" maxlength="30" class="form1"/></td>
								</tr>
								<tr>	
									<td>&nbsp;</td>
									<td class="formText">Status</td>
									<td valign="middle">
										<select class="form2" name="status" id="status">
											<option value="">All</option>
											<option value="2">Active</option>
											<option value="3">InActive</option>
										</select>
									</td>
									<td class="formText">Negative Marking</td>
			    					<td><select class="form2" name="negative_enable" id="negative_enable">
										<option value="">All</option>
										<option value="0">Disable</option>
										<option value="1">Enable</option>
										</select></td>
								</tr>
								
								<tr>
									<td>&nbsp;</td>
									<td class="formText">Exam Created from</td>
									<td valign="middle">
										<input type="text" name="startDate" id="startDate" value="<%=new java.text.SimpleDateFormat("MM/01/yyyy").format(new java.util.Date())%>"
										class="form1" readonly="true"/><a href="Javascript:ShowCalendar(document.getElementById('startDate'),2010,2050,'mm/dd/yyyy')" border="0" >
										<img src="images/icon_calendar.gif" width="16" height="15" border="0" hspace="5"></a>	
									</td>
									<td class="formText">To Date</td>
									<td valign="middle">
										<input type="text" name="endDate" id="endDate" 
										class="form1" readonly="true" value="<%=new java.text.SimpleDateFormat("MM/dd/yyyy").format(new java.util.Date())%>"/><a href="Javascript:ShowCalendar(document.getElementById('endDate'),2010,2050,'mm/dd/yyyy')" border="0" >
										<img src="images/icon_calendar.gif" width="16" height="15" border="0" hspace="5"></a>
									</td>									
								</tr>
								<tr>
									<td>&nbsp;</td>
									<td class="formText">Multiple Choice</td>
			    					<td><select class="form2" name="multiple_choice_enable" id="multiple_choice_enable">
										<option value="">All</option>
										<option value="0">Disable</option>
										<option value="1">Enable</option>
										</select></td>
									<td class="formText"></td>
			    					<td></td>
								</tr>
								<tr>
									<td height="25" colspan="6" align="center" valign="top" >&nbsp;</td>
								</tr>
								<tr>
									<td height="25" colspan="4" align="center" valign="top">
										<a onclick="javascript:showReport();" style="" href="jsp/reportLightBox.jsp?height=520&width=770&modal=true" class="thickbox">
										<input type="button" class="imageButton" value="Show" ></a>
									</td>
								</tr>
								<tr>
									<td height="25" colspan="4" align="center" valign="top" >&nbsp;</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>						